<template>
	<view class="content">
		<my-bar> 
			<block slot="content">{{ title }}</block>
			<!--#ifdef MP-WEIXIN-->
			<block slot="backText"><button class="cu-btn bg-gradual-green margin-right-xs" @click.stop="goToAdd">添加</button></block>
			<!--#endif-->
			<!--#ifndef MP-WEIXIN-->
			<block slot="right"><button class="cu-btn bg-gradual-green margin-right-xs" @click.stop="goToAdd">添加</button></block>
			<!--#endif-->
		</my-bar>
		<my-card-list s
			:listData="listData"
			:showHeader="false"
			url="/pages/post/detail"
			:deleteUrl="$store.state.pages.admin.dormitory.delete.url"
			:updatePath="addPath"
			type="swipeaction"
		></my-card-list>
	</view>
</template>

<script>
import baseMixin from '@/mixin/base.js';
import pageMixin from '@/mixin/page.js';
import myCardList from '@/components/my-card-list/my-card-list.vue';
export default {
	components: {
		myCardList
	},
	mixins: [baseMixin, pageMixin],
	computed: {
		addPath() {
			return this.$store.state.pages.admin.dormitory.add.path;
		},
		title() { 
			return this.$store.state.pages.admin.dormitory.list.text;
		}
	},
	data() {  
		return {};
	},
	onLoad(e) {
		this.fetchList(this.$store.state.pages.admin.dormitory.list.url);
	},
	onReachBottom() {
		this.fetchList(this.$store.state.pages.admin.dormitory.list.url);
	},
	methods: {
		goToAdd(path) {
			this.$util.goTo(this.addPath);
		}
	}
};
</script>

<style lang="scss"></style>
